package com.ruicar.afs.cloud.channel.online.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.channel.common.condition.BaseInfoTypeDTO;
import com.ruicar.afs.cloud.channel.online.condition.ChannelOnlineCondition;
import com.ruicar.afs.cloud.channel.online.condition.DevelopDTO;
import com.ruicar.afs.cloud.channel.online.condition.RegionDTO;
import com.ruicar.afs.cloud.channel.online.entity.ChannelBaseInfoTemp;
import com.ruicar.afs.cloud.channel.online.vo.ChannelBulkEditingQuotaInfoVo;
import com.ruicar.afs.cloud.channel.online.vo.ChannelOnlineInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author mingzhi.li
 * @version 1.0
 * @date 2020/05/19 11:18
 */
public interface ChannelOnlineMapper extends BaseMapper<ChannelBaseInfoTemp> {

    /**
     * 渠道基本信息
     *
     * @param condition
     * @return
     */
    ChannelBaseInfoTemp getChannelBaseInfoTemp(ChannelOnlineCondition condition);

    /**
     * 多条件查询渠道列表
     *
     * @param page
     * @param condition
     * @return
     */
    IPage<ChannelOnlineInfoVo> getChannelInfo(Page page, @Param("query") ChannelOnlineCondition condition);

    /**
     * 多条件查询渠道展业区域
     *
     * @param page
     * @param condition
     * @return
     */
    IPage<List<ChannelOnlineInfoVo>> getAreaListInfo(Page page, @Param("query") ChannelOnlineCondition condition);

    /**  地域树获取合作商信息*/
    IPage<List<ChannelOnlineInfoVo>> getByRegion(Page page, @Param("query") RegionDTO condition,@Param("codes") List<String> codes,@Param("channelIds") List<Long> channelIds);

    /**  地域树获取合作商信息*/
    IPage<List<ChannelOnlineInfoVo>> getByDevelop(Page page, @Param("query") DevelopDTO condition, @Param("ids") List<Long> ids);

    /**下面一段东西都是垃圾，请以后的大佬删掉 */
    List<ChannelBaseInfoTemp> getBaseInfoByStatus(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOtherAll(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOwnAll(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOnlyOwnAll(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOnlyOwnType(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOnlyOtherAll(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOnlyOtherType(@Param("query") BaseInfoTypeDTO dto);

    List<ChannelBaseInfoTemp> getBaseInfoByStatusOtherOnlyOwnOnly(@Param("query") BaseInfoTypeDTO dto);

    /**上面一段东西都是垃圾，请以后的大佬删掉 */

    List<ChannelBulkEditingQuotaInfoVo> getByConditionForBulkEditing(@Param("query")ChannelOnlineCondition condition);
    List<ChannelBulkEditingQuotaInfoVo> getAllByConditionForBulkEditing(@Param("query")ChannelOnlineCondition condition);
}
